package com.mrjoew.weekend.entities.dto;

import com.mrjoew.weekend.constants.RegexConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

/**
 * @author Christopher Jones
 * @ClassName RegisterDTO
 * @explain
 * @date 2020/11/7 0007 22:10
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RegisterDTO {

    /**
     * 账号
     */
    @Length(min = 6, max = 20, message = "账号为6-20个字符之间")
    @Pattern(regexp = RegexConstant.MOBILE, message = "账号格式错误")
    private String account;

    /**
     * 密码
     */
    @Length(min = 8, max = 20, message = "密码为8-16个字符之间")
    @Pattern(regexp = RegexConstant.PASSWORD_NORMAL, message = "密码格式错误")
    private String password;
}
